Partial Evaluation of Call-by-value -calculus with Side-effects

نویسندگان

  • Kenichi Asai
  • Hidehiko Masuhara
  • Akinori Yonezawa
چکیده

We present a framework of an online partial evaluator for a callby-value -calculus with destructive updates of data structures. It properly and correctly specializes expressions that contain sideeffects, while preserving pointer equality, which is an important property for programs using updates. Our partial evaluator uses a side-effect analysis to extract immutable data structures and then performs an online specialization using preactions. Once mutable and immutable data structures are separated, partial evaluation is done in such a way that accessesto immutable ones are performed at specialization time, while accessesto mutable ones are residualized. For the correct residualization of side-effecting operations, preactions are used to solve various issues, including code elimination, code duplication, and execution order preservation. The preaction mechanism also enablesus to reduce expressions that were residualized when the conventional let-expression approach of Similix was used. The resulting partial evaluator is simple enough to prove its correctness. Based on the framework, we have constructed a partial evaluator for Scheme, which is powerful enough to specialize fairly complicated programs with side-effects, such as an interpreter.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Partial Evaluation of Call - by - value - calculus with Side - e ects

We present a framework of an online partial evaluator for a call-by-value -calculus with destructive updates of data structures. To our knowledge, this is the rst partial evaluator that can deal with full side-e ects as well as pointer equality in higher-order languages. Our partial evaluator uses a side-e ect analysis for handling assignment operations and then performs an online specializatio...

متن کامل

Pragmatic Aspects of Type-Directed Partial Evaluation

Type-directed partial evaluation stems from the residualization of static values in dynamic contexts, given their type and the type of their free variables. Its algorithm coincides with the algorithm for coercing a subtype value into a supertype value, which itself coincides with Berger and Schwichtenberg’s normalization algorithm for the simply typed λ-calculus. Type-directed partial evaluatio...

متن کامل

A polynomial time {\lambda}-calculus with multithreading and side effects

The framework of light logics has been extensively studied to control the complexity of higher-order functional programs. We propose an extension of this framework to multithreaded programs with side effects, focusing on the case of polynomial time. After introducing a modal λ-calculus with parallel composition and regions, we prove that a realistic call-by-value evaluation strategy can be comp...

متن کامل

Normalization and Partial Evaluation

We give an introduction to normalization by evaluation and type-directed partial evaluation. We first present normalization by evaluation for a combinatory version of Gödel System T. Then we show normalization by evaluation for typed lambda calculus with β and η conversion. Finally, we introduce the notion of binding time, and explain the method of type-directed partial evaluation for a small P...

متن کامل

Call-by-Value, Call-by-Name and the Logic of Values

We introduce two logics for partiality, a call-by-value logic and a call-by-name logic. Both logics are variants of the logic of partial terms, an extension of the first-order predicate calculus by a definedness predicate. In our logics, however, quantifiers may only be instantiated to value terms and not to arbitrary, defined terms as in the logic of partial terms. We show that the call-by-val...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007